﻿alter table MeasurementType add DisplayOrder int null
alter table MeasurementType add AccountId int null
alter table MeasurementType add constraint fk_MeasurementTypeToAccount foreign key (AccountId) references Account (AccountId)
go
update MeasurementType set DisplayOrder=1 where Description='Weight'
update MeasurementType set DisplayOrder=2 where Description='Body Fat %'
update MeasurementType set DisplayOrder=3 where Description='BMI'
update MeasurementType set DisplayOrder=4 where Description='Waist'
update MeasurementType set DisplayOrder=5 where Description='Chest'
update MeasurementType set DisplayOrder=6 where Description='Arms'
update MeasurementType set DisplayOrder=7 where Description='Thighs'
update MeasurementType set DisplayOrder=8 where Description='Height'
go
alter table MeasurementType alter column DisplayOrder int not null
go 